﻿package  
{
	
	import flash.display.MovieClip;
	
	
	public class SelectPlayerUI extends MovieClip 
	{
		
		
		public function SelectPlayerUI() 
		{
			// constructor code
			
			
		}
		
		
		public function clear():void
		{
			newPlayer1.visible = false;
			loginButton1.visible = false;
			deleteButton1.visible = false;
			nameText1.text = "";
			levelText1.text = "";
			hpText1.text = "";
			strText1.text = "";
			defText1.text = "";
			sqdText1.text = "";
			charmText1.text = "";
			dpText1.text = "";
			loginText1.text = "";
			
			
			newPlayer2.visible = false;
			loginButton2.visible = false;
			deleteButton2.visible = false;
			
			nameText2.text = "";
			levelText2.text = "";
			hpText2.text = "";
			strText2.text = "";
			defText2.text = "";
			sqdText2.text = "";
			charmText2.text = "";
			dpText2.text = "";
			loginText2.text = "";
			
		}
		
		
		public function setPlayer( data1:Object , data2:Object ):void
		{
			clear();
			
			if ( data1 )
			{
				data1.image;
				nameText1.text = data1.name;
				levelText1.text = data1.level;
				hpText1.text = data1.hp;
				strText1.text = data1.str;
				defText1.text = data1.def;
				sqdText1.text = data1.sqd;
				charmText1.text = data1.charm;
				dpText1.text = data1.dp;
				loginText1.text = data1.login;
				
				newPlayer1.visible = true;
			}
			else
			{
				loginButton1.visible = true;
				deleteButton1.visible = true;
			}
			
			
			if ( data2 )
			{
				data2.image;
				nameText2.text = data2.name;
				levelText2.text = data2.level;
				hpText2.text = data2.hp;
				strText2.text = data2.str;
				defText2.text = data2.def;
				sqdText2.text = data2.sqd;
				charmText2.text = data2.charm;
				dpText2.text = data2.dp;
				loginText2.text = data2.login;
				
				newPlayer2.visible = true;
			}
			else
			{
				loginButton2.visible = true;
				deleteButton2.visible = true;
			}
		}
		
	}
	
}
